// const small = window.ax.config.size === 'small';
const small = true;
//生成年份选择项
const getYearList = config => {
  let yearList = [];
  if (config.all) yearList.push({ text: '全部', value: '' });
  for (let i = config.min; i <= config.max; i++) {
    yearList.push({ text: i + config.words, value: i });
  }
  return yearList;
};
//生成完整月份选择项
const getMonthList = () => {
  let monthList = [];
  for (let i = 1; i <= 12; i++) {
    monthList.push({ text: i + '月', value: i });
  }
  return monthList;
};

const axconstInit = {
  valid: {
    mobile: {
      reg: /^1[3456789]\d{9}$/,
      message: '请输入正确的手机号',
    },
    /** 正整数和0 */
    pInt: {
      reg: /^[\d]+$/,
      message: '请输入正整数或者零',
    },
    /** 正整数 */
    int: {
      reg: /^[1-9]\d*$/,
      message: '请输入正整数',
    },
    /** 正浮点数 */
    pFloat: {
      reg: /^\d+(\.\d+)?$/,
      message: '请输入正浮点数',
    },
    idCard: {
      reg: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
      message: '请输入正确的身份证号码',
    },
    idCardEx: {
      reg: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)|(^无身份证号码$)/,
      message: '请输入正确的身份证号码',
    },
    picture: {
      reg: /(.*)\.(jpg|bmp|gif|ico|pcx|jpeg|tif|png|raw|tga)$/,
      message: '请输入正确的图片格式',
    },
    email: {
      reg: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
      message: '请输入正确的邮箱地址',
    },
  },
  /** 不展示label */
  inlineFormItemLayoutNoLabel: {
    labelCol: {
      sm: { span: 0 },
    },
    wrapperCol: {
      sm: { span: 24 },
    },
  },
  inlineFormItemLayout: {
    labelCol: {
      sm: { span: 6 },
    },
    wrapperCol: {
      sm: { span: 18 },
    },
  },
  inlineFormItemLayoutAllRowTwo: {
    labelCol: {
      sm: { span: 3 },
    },
    wrapperCol: {
      sm: { span: 21 },
    },
  },
  inlineFormItemLayoutAllRowThree: {
    labelCol: {
      sm: { span: 2 },
    },
    wrapperCol: {
      sm: { span: 22 },
    },
  },
  searchForm: {
    gutter: {
      // 栅格之间的间隔
      md: 8, // 中等屏幕
      lg: 24, // 大屏幕
      xl: 48, // 超大屏幕
    },
    span: {
      md: 8,
      sm: 24,
    },
  },
  page: {
    params: {
      currentPage: 1,
      pageSize: 20,
    },
    getParams: pagination => ({
      currentPage: pagination.current,
      pageSize: pagination.pageSize,
    }),
  },
  width: {
    id: small ? 186 : 150,
    org: small ? 120 : 108,
    idcard: small ? 162 : 185,
    voucher: small ? 187 : 185,
    voucheronly: small ? 169 : 185,
    financeonly: small ? 168 : 185,
    bill: small ? 124 : 185,
    scheme: 210,
    operate4: 96,
    operate5: 140,
    operate6: small ? 118 : 150,
    operate7: small ? 148 : 150,
    operate8: 194,
    operate9: 208,
    operate10: 222,
    operate11: 236,
    operate12: 250,
    operate16: 308,
    examNumber: small ? 155 : 150,
    major: 185,
    date: 108,
    times: small ? 89 : 100,
    time: small ? 148 : 170,
    timex: 296,
    checkbox: small ? 38 : 45,
    two: small ? 48 : 62,
    twox: small ? 50 : 62,
    threeonly: small ? 62 : 74,
    three: 78,
    four: small ? 92 : 108,
    fouronly: small ? 73 : 108,
    five: small ? 87 : 110,
    six: small ? 101 : 122,
    seven: small ? 115 : 122,
    eight: small ? 131 : 122,
    nine: small ? 143 : 122,
    ten: 160,
    phone: small ? 101 : 122,
    long: 185,
    longx: 360,
    longxl: 450,
    remark: 240,
    longs: 270,
    majors: 165,
    class: 110,
    region: 146,
    school: 130,
    email: 213,
    app: 159,
    nation: 76,
    bankCard: 186,
    birthday: 90,
    address: 186,
    cas: small ? 143 : 122,
    casCode: small ? 101 : 122,
    material: small ? 185 : 122,
    materialCode: small ? 101 : 122,
    supplierName: small ? 101 : 122,
    productName: small ? 101 : 122,
    casCode: small ? 101 : 122,
    categoryName: small ? 101 : 122,
    purity: small ? 101 : 122,
    price: small ? 101 : 122,
    character: small ? 101 : 122,
    unit: small ? 101 : 122,
    onePackingUnit: small ? 101 : 122,
    oneCapacity: small ? 101 : 122,
    packingSpec: small ? 101 : 122,
    alias: small ? 101 : 122,
    eName: small ? 101 : 122,
    brand: small ? 101 : 122,
    factory: small ? 101 : 122,
    productDate: small ? 101 : 122,
    validityDays: small ? 101 : 122,
    formula: small ? 101 : 122,
    molecular: small ? 101 : 122,
    techParameter: small ? 101 : 122,
    productSpec: small ? 101 : 122,
    stock: small ? 101 : 122,
    image: small ? 101 : 122,
    productStatus: small ? 101 : 122,
    controlLevel: small ? 101 : 122,
    packingUnit: small ? 101 : 122,
    orderId: small ? 101 : 122,
    orderTitle: small ? 101 : 122,
    fundsName: small ? 101 : 122,
    labName: small ? 101 : 122,
    flowTitle: small ? 101 : 122,
    flowId: small ? 101 : 122,
    deptName: small ? 101 : 122,
  },
  //招生年份
  year: getYearList({ max: 2022, min: 2016, all: false, words: '' }),
  yearFull: getYearList({ max: 2022, min: 2016, all: true, words: '年' }),
  //年月选择项(宽幅)
  selectYear: getYearList({ max: 2025, min: 2010, all: false, words: '年' }),
  selectMonth: getMonthList({ all: false }),
  selectFullYear: getYearList({ max: 2025, min: 2010, all: true }),
  //招生老师筛选
  enrollYear: getYearList({ max: 2022, min: 2018, all: false, words: '年' }),
  month: [
    {
      text: '3',
      value: 3,
    },
    {
      text: '9',
      value: 9,
    },
  ],
  /**扣回状态选择 */
  deductedStatus: [
    {
      text: '全部扣回',
      value: 0,
    },
    {
      text: '部分扣回',
      value: 1,
    },
  ],
  /** 顶部菜单 */
  header: {
    /** 高度 */
    height: 48,
  },
  initialList: {
    list: [],
    pagination: {},
  },
  data: {
    list: [
      {
        id: 0,
        material: '浓硫酸',
        materialCode: 'bx1012101010',
        cas: '浓硫酸',
        casCode: 'AS-012012',
        currentCount: '12ml/1000ml',
        solidCount: '500ml',
        isIn: '是',
        character: '液体',
        unit: '瓶',
        period: '2022-01-26',
        maxCount: '2000ml',
        purity: '100%',
        unitCount: '200ml',
        useCount: '200ml',
        unitIdentity: 'ml',
        supply: '京东自营',
        purchaseUser: '李四',
        surplus: '500ml',
        phone: '15828549701',
        outCount: '200ml',
        back: 1,
        outNumber: 'OX-215452022',
        receiver: '张三',
        receiveAmount: '201ml',
        backAmount: '100ml',
        useAmount: '101ml',
        count: '5',
        receiveTime: '2022-01-26 11:01:11',
        backStatus: '待返库',
        remark: '备注信息',
        checkStatus: '审核中',
        addr: '郫都区红光街道广场路北三段188号',
        schoolId: 'ST-212154212120',
        userType: '负责人',
        checkContent: '李四申请使用采购主体1',
        orderInfo: '购买xxx化工经销商商品50件',
        orderCount: '50',
        orderNumber: 'OD-2121545453',
        orderMoney: '￥299',
        orderStatusComplete: '已完结',
        orderStatus: '审核中',
        goodsCapacity: '99ml/瓶',
        packageSpecs: '24瓶/件',
        unitPrice: '￥29',
        orderUser: '张三',
        carNum: '川A 521S90',
        fund: '经费02',
        project: '项目02',
        // fund: '化学实验经费',
      },
      {
        id: 1,
        material: '浓硫酸2',
        materialCode: 'bx1012101010',
        cas: '浓硫酸2',
        casCode: 'AS-012012',
        currentCount: '12ml/1000ml',
        solidCount: '500ml',
        isIn: '是',
        character: '液体',
        unit: '瓶',
        period: '2022-01-26',
        maxCount: '2000ml',
        purity: '90%',
        unitCount: '200ml',
        useCount: '200ml',
        unitIdentity: 'ml',
        supply: '京东自营',
        purchaseUser: '王五',
        surplus: '500ml',
        phone: '15828549702',
        outCount: '200ml',
        back: 0,
        outNumber: 'OX-215452023',
        receiver: '赵七',
        receiveAmount: '202ml',
        backAmount: '99ml',
        useAmount: '102ml',
        count: '4',
        receiveTime: '2022-01-26 11:01:12',
        backStatus: '待返库',
        remark: '备注信息1',
        checkStatus: '已通过',
        addr: '四川省成都市郫都区红光街道广场路北三段189号',
        schoolId: 'ST-212154212121',
        userType: '使用人',
        checkContent: '李四申请使用采购主体2',
        orderInfo: '购买xxx化工经销商商品51件',
        orderCount: '51',
        orderNumber: 'OD-2121545454',
        orderMoney: '￥300',
        orderStatus: '送货中',
        orderStatusComplete: '已完结',
        goodsCapacity: '100ml/瓶',
        packageSpecs: '24瓶/件',
        unitPrice: '￥30',
        orderUser: '李四',
        carNum: '川A 521S91',
        fund: '经费01',
        project: '项目01',
        // fund: '化学实验经费',
      },
    ],
    pagination: {
      current: 1,
      pageSize: 20,
      total: 2,
    },
  },
  useRecord: {
    list: [
      {
        id: 0,
        user: '李四',
        used: '100ml',
        outTime: '2022-01-26 11:01:56',
        remark: '做化学实验',
      },
      {
        id: 1,
        user: '王五',
        used: '102ml',
        outTime: '2022-01-26 11:01:56',
        remark: '做化学实验',
      },
    ],
    pagination: {
      current: 1,
      pageSize: 20,
      total: 2,
    },
  },
};
axconstInit.initialList.list.initialData = true;
export const axconst = axconstInit;
export const axconfig = {
  size: (window['ax'] && window['ax'].config && window['ax'].config.size) || 'small',
};
